Skip to content

feat(config-registry-controller)!: index configs by caip chain id#9606

Merged
mikesposito merged 4 commits into
mainfrom
me/config-registry-network-caip2-chainid
Jul 23, 2026
Merged

feat(config-registry-controller)!: index configs by caip chain id#9606
mikesposito merged 4 commits into
mainfrom
me/config-registry-network-caip2-chainid

Conversation

@mikesposito

@mikesposito mikesposito commented Jul 22, 2026

Copy link
Copy Markdown
Member

Explanation

The ConfigRegistryControllerState.configs.networks type is being narrowed down to Record<CaipChainId, RegistryNetworkConfig> instead of Record<string, RegistryNetworkConfig>

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Breaking TypeScript types for configs.networks and lookup parameters require consumer updates; runtime behavior is mostly unchanged aside from stricter chain ID validation on API responses.

Overview
BREAKING: Network configs in controller state are now keyed and typed as CaipChainId instead of arbitrary strings. ConfigRegistryControllerState.configs.networks becomes Record<CaipChainId, RegistryNetworkConfig>, and getNetworkConfigByCaip2ChainId takes a CaipChainId argument.

Registry API parsing now validates each chain’s chainId with CaipChainIdStruct from @metamask/utils, so only CAIP-2-shaped IDs (e.g. eip155:1) are accepted at the type/schema layer. The changelog documents the breaking state shape change and ties it to the existing lookup API.

Reviewed by Cursor Bugbot for commit 8c8a1f8. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread packages/config-registry-controller/CHANGELOG.md Outdated
Comment thread packages/config-registry-controller/CHANGELOG.md Outdated
Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com>
Comment thread packages/config-registry-controller/CHANGELOG.md Outdated
@mikesposito
mikesposito marked this pull request as ready for review July 22, 2026 15:39
@mikesposito
mikesposito requested review from a team as code owners July 22, 2026 15:39
@mikesposito
mikesposito added this pull request to the merge queue Jul 23, 2026
Merged via the queue into main with commit 077d673 Jul 23, 2026
431 checks passed
@mikesposito
mikesposito deleted the me/config-registry-network-caip2-chainid branch July 23, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants